//
//  SCCommonAlertView.h
//  Shuaiche
//
//  Created by dangshuai on 2018/12/20.
//  Copyright © 2018 zzs. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface SCAlertContentView : UIView
@property (nonatomic, assign) CGFloat offsetY;
@property (nonatomic, assign) CGFloat cornerRadius;
@property (nonatomic, strong) UIColor *color;
@property (nonatomic, assign) CGFloat horizontalPadding;
@property (nonatomic, assign) CGFloat spacing;

@property (nonatomic, strong) UIStackView *stackView;
- (void)addView:(UIView *)view;
- (void)insertView:(UIView *)view atIndex:(NSInteger)index;
@end

@interface SCCommonAlertView : UIView

@property (nonatomic, assign) BOOL alwaysShow;//点击按钮是否自动隐藏
@property (nonatomic, assign) BOOL hideWhenTapBack; // 点击蒙版隐藏，默认不隐藏

@property (nonatomic, assign) NSTextAlignment titleAlignment;
@property (nonatomic, assign) NSTextAlignment messageAlignment;

//- (instancetype)initWithTitle:(NSString *)title message:(NSString *)message cancelBtnTitle:(NSString *)cancelTitle otherBtnTitle:(NSString *)otherBtnTitle clickIndexBlock:(void(^)(NSInteger index))block;

///
/// ShuaiChe 自定义公共弹窗
/// @param title 标题
/// @param message 内容
/// @param main 主按钮
/// @param other 其他按钮
/// @param block 回调
///
- (instancetype)initWithTitle:(NSString *)title
                      message:(NSString *)message
                      mainAct:(NSString *)main
                     otherAct:(NSString *)other
                  handleBlock:(void(^)(NSInteger index))block;

// 建议使用
- (instancetype)initWithTitle:(NSString *)title
                      message:(NSString *)message
                          tip:(NSString *)tip
                      mainAct:(NSString *)main
                     otherAct:(NSString *)other
                  handleBlock:(void(^)(NSInteger index))block;

+ (instancetype)showTitle:(NSString *)title
                  message:(NSString *)message
                  mainAct:(NSString *)main
                 otherAct:(nullable NSString *)other
              handleBlock:(void(^)(NSInteger index))block;


//+ (instancetype)showWithTitle:(NSString *)title message:(NSString *)message cancelBtnTitle:(NSString *)cancelTitle otherBtnTitle:(NSString *)otherBtnTitle clickIndexBlock:(void(^)(NSInteger index))block;

- (void)show;

- (void)showWithView:(UIView *)view;

- (void)hideView;

- (void)insertCustomView:(UIView *)customeView atIndex:(NSInteger)index;

- (void)insertCustomViewHeight:(UIView *)customeView atIndex:(NSInteger)index;

- (void)setTitleColor:(UIColor *)color forButtonAtIndex:(NSInteger)index;

- (void)addButtonClickBlock:(void(^)(NSInteger index))block;

- (void)addTopImageView:(NSString *)imageName;

- (void)addTextFieldWithConfigurationHandler:(void (^)(UITextField *textField))configurationHandler;

- (void)addTextFieldWithMessage:(NSString *)message configurationHandler:(void (^)(UITextField *textField, UILabel *messageLab))configurationHandler alwaysShow:(BOOL)noHid;
- (void)setMessageColor:(UIColor *)color;
@property (nullable, nonatomic, readonly) NSArray<UITextField *> *textFields;

@end

NS_ASSUME_NONNULL_END
